package com.day0906;

import java.util.Scanner;

public class Text6 {
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        System.out.println("请输入你的四位数会员卡号：");
        int num = in.nextInt();
        int numQian = num / 1000;//千位
        int numBai = num % 1000 / 100;//百位
        int numShi = num % 1000 % 100 / 10;//十位
        int numG = num % 1000 % 100 % 10;//个位

        int sum = numQian + numBai + numShi + numG;
        System.out.println("和为：" + sum);
    }
}
